package com.jkoss.dao.oa;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

import com.jkoss.pojo.oa.Department;
import com.jkoss.pojo.oa.Emps;
import com.jkoss.pojo.oa.EmpsExample;
import com.jkoss.tool.Page;

public interface EmpsMapper {
	
	
	@Select("select a.eid  from t_emps a,t_jobs b, t_department c where a.jobid=b.jobid   and b.depID =c.depID  and a.ename=#{ename} and  c.depname=#{depname}")
	@ResultType(java.lang.Integer.class)
	Integer findStuIdByName_clsName(@Param("ename") String ename,@Param("depname")  String depname);
	
	
	@Select("select a.eid,c.depname as qqe,a.ename  from t_emps a,t_jobs b ,t_department c where a.jobid=b.jobid   and b.depID =c.depID and a.outDate is null")
	@ResultMap("com.jkoss.dao.oa.EmpsMapper.BaseResultMap3")
	List<Emps> selectDeptwithEmps();
	
	@Select("select * from t_emps")
	@ResultMap("com.jkoss.dao.oa.EmpsMapper.BaseResultMap")
	List<Emps> selectAtPage(Page page);
	
	@Select("select * from t_emps")
	@ResultMap("com.jkoss.dao.oa.EmpsMapper.BaseResultMap")
	List<Emps> findAllEmp();
	
   /*	@Select("select  a.*,b.*,c.* from t_emps a,t_empdetail b,t_sysright c,t_emp2right d "
			+ "where a.empdid=b.empdid and a.eid=d.eid and c.rtid=d.rtid and lgnName = #{lgnName}")*/
	@Select("select  * from t_emps  where lgnName = #{lgnName}")
	@ResultMap("com.jkoss.dao.oa.EmpsMapper.BaseResultMap")
    Emps selectByLgnName(String lgnName);
 
	@Select("select  * from t_emps  where eid = #{eid}")
	@ResultMap("com.jkoss.dao.oa.EmpsMapper.BaseResultMap2")
    Emps selectByID(int eid);
	
	@Select("select a.* from t_emps a,t_jobs b,t_department c where a.jobid=b.jobid and b.depID=c.depID and c.depID=#{dptID}")
	@ResultMap("com.jkoss.dao.oa.EmpsMapper.BaseResultMap")
	List<Emps> selectEmpsByDpt(int  dptID);
	
	
    int countByExample(EmpsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_emps
     *
     * @mbggenerated
     */
    int deleteByExample(EmpsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_emps
     *
     * @mbggenerated
     */
    int deleteByPrimaryKey(Integer eid);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_emps
     *
     * @mbggenerated
     */
    int insert(Emps record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_emps
     *
     * @mbggenerated
     */
    int insertSelective(Emps record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_emps
     *
     * @mbggenerated
     */
    List<Emps> selectByExample(EmpsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_emps
     *
     * @mbggenerated
     */
    Emps selectByPrimaryKey(Integer eid);
    
    


    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_emps
     *
     * @mbggenerated
     */
    int updateByExampleSelective(@Param("record") Emps record, @Param("example") EmpsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_emps
     *
     * @mbggenerated
     */
    int updateByExample(@Param("record") Emps record, @Param("example") EmpsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_emps
     *
     * @mbggenerated
     */
    int updateByPrimaryKeySelective(Emps record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_emps
     *
     * @mbggenerated
     */
    int updateByPrimaryKey(Emps record);
}